:root {
    /* Variáveis de cor [DEFAULT MODE] */
    --background-color: #F8F8FF;
    --primary-color: #011638;
    --secondary-color: #B9AFA2;
    --secondary-color-outline: #8C7D69;
    --third-color: #AEC3D6;
    --success: #1b9470;
    --warning: #FFB752;
    --error: #890047;
    --white: #F8F8FF;
    --black: #0e0f10;

    /* Variáveis de texto */
    --font-family: Verdana, Geneva, Tahoma, sans-serif;

    /* Escala baseada em tamanho */
    --fs-ppp: 0.55rem;
    --fs-pp: 0.75rem;
    --fs-p: 0.875rem;
    --fs-base: 1rem;
    --fs-m: 1.125rem;
    --fs-g: 1.5rem;
    --fs-gg: 2rem;
    --fs-ggg: 3rem;

    /* Escala por função/tipo */
    --fs-h1: 2.5rem;
    --fs-h2: 2rem;
    --fs-body: 1rem;
    --fs-caption: 0.75rem;


    /* Variáveis de espaçamento */
    --space-4px: 0.25rem;
    --space-8px: 0.5rem;
    --space-12px: 0.7rem;
    --space-16px: 1rem;
    --space-24px: 1.5rem;
    --space-32px: 2rem;
    --space-56px: 3.5rem;
    --space-64px: 4rem;
}

/* [DARK MODE] */
.dark-mode {
    background-color: #011223;
}

/*KEYFRAMES*/

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0px);
    }
}


/* Elementos padrão */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    width: 100%;
    /* min-height: 100vh; */
    background-color: var(--background-color);
    font-family: var(--font-family);
}

header {
    width: 100%;
    min-height: var(--space-64px);
    margin-bottom: var(--space-32px);
    background-color: var(--primary-color);
    color: var(--white);
}

header nav {
    width: 100%;
    min-height: var(--space-64px);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-24px);
}

header nav a {
    text-decoration: none;
    display: flex;
    justify-self: left;
    color: var(--white);
    font-weight: bold;
    align-self: center;
}

.container {
    width: 70%;
    max-width: 1200px;
    margin: var(--space-24px) auto;
}

h2 {
    font-size: var(--fs-m);
}

/* FORMULÁRIOS */

.container form {
    width: 50%;
    /* max-width: 860px; */
    height: auto;
    padding: var(--space-32px);
    border-radius: 8px;
    display: flex;
    gap: var(--space-16px);
    background-color: var(--secondary-color);
}

input,
select {
    width: 100%;
    border: 2px var(--secondary-color-outline) solid;
    border-radius: 8px;
    padding: var(--space-8px);
    /* margin-top: 10px; */
    outline: none;
    background-color: var(--background-color);
}

input:focus,
select:focus {
    border-color: var(--third-color);
}

.input-item {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-4px);
}

.input-group,
.input-group-number,
.input-group-date {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: var(--space-24px);
}

input[type=number] {
    width: 100%;
}

input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

input[type=date]::-webkit-datetime-edit {
    font-family: Arial, Helvetica, sans-serif;
}

.input-radio .input-radio-label {
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: 20px;
}

.input-radio .input-radio-item {
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: 20px;
}

.input-item .form-error {
    display: none;
    font-size: var(--fs-pp);
    color: var(--error);
}

input[type=checkbox]:checked {
    accent-color: var(--success);
}

.input-campo {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
}

/*Select Input MODE*/
.select-menu input,
.input-cadastro {
    display: none;
}

.cadastro-btn {
    width: 100%;
    height: 36px;
    border: none;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

button {
    width: 100%;
    height: 60px;
    padding: var(--space-12px);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    justify-self: flex-end;
    cursor: pointer;
    background-color: var(--third-color);
    transition: ease-in-out 0.2s;
    gap: var(--space-12px);
}

/* button:hover{
    filter: brightness(120%);
    transform: scale(1.2);
    box-shadow: 2px 2px 5px #0000006a;
} */

.toggle-btn {
    width: 10%;
    height: 37px;
    padding: var(--space-4px);
    display: flex;
    align-self: flex-end;
    align-items: center;
}

/* TABELAS*/
/*DROPDOWNS*/

.button-submit-campo {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-8px);
}

.button-submit-campo .no-form {
    width: auto;
    display: inline-flex;
}

.button-submit-campo .no-form button {
    width: auto;
    min-width: 32px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    padding: 4px;
    border: none;
    cursor: pointer;
}

.table-dropdown-content {
    width: 90%;
    display: flex;
    justify-self: right;
}

.dropdown-content {
    display: none;
}

.header-container {
    width: 100%;
    height: 50px;
    padding: var(--space-12px);
    display: flex;
    align-items: center;
    margin: var(--space-12px) 0px var(--space-12px) 0;
    background-color: var(--third-color);
    cursor: pointer;
    border-radius: var(--space-8px);
}

.dropdown-table,
h4 {
    cursor: pointer;
    margin-left: var(--space-24px);
}

/*FAKE TABLE*/

.thead {
    font-weight: bold;
    border-bottom: 2px solid var(--primary-color);
    background-color: var(--secondary-color);
}

.tr {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--space-12px);
    padding: var(--space-8px);
    cursor: auto;
    border-bottom: 1px solid var(--primary-color);
}

.tr>* {
    min-width: 0;
    overflow-wrap: anywhere;
}

.row:hover {
    background-color: #0e0f1018;
}

/*---------------------------------*/

img {
    max-width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

img[src*="icons"],
td button img,
.button-submit-campo button img {
    width: 28px;
    height: 28px;
    max-width: none;
    object-fit: contain;
}

#listaTable {
    width: 100%;
}

table {
    width: 100%;
    /* max-width: 100%; */
    height: auto;
    border-collapse: collapse;
    margin: var(--space-32px) 0px;
}

.tr {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--space-12px);
    padding: var(--space-8px);
    cursor: auto;
    border-bottom: 1px solid var(--primary-color);
}

.tr>* {
    min-width: 0;
    overflow-wrap: anywhere;
}

thead tr {
    height: var(--space-32px);
    border: none;
    border-bottom: 3px solid var(--primary-color);
    background-color: var(--secondary-color);
}

nav p {
    width: 100%;
    position: relative;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    color: var(--black);
    cursor: pointer;
    z-index: 1;
}

nav span {
    width: 50%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 8px;
    background-color: var(--third-color);
    transition: ease-in-out 0.3s;
}

nav p:nth-child(1):hover~span {
    left: 0;
}

nav p:nth-child(2):hover~span {
    left: 50%;
}

.title3 {
    width: 100%;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--secondary-color);
}

.menu-selecao {
    width: 100%;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    margin-top: var(--space-32px);
}

tr {
    border: 1px solid var(--black);
    border-right: none;
    border-left: none;
    text-align: center;
    white-space: nowrap;
}

tbody tr:hover {
    background-color: #0000001b;
}

th,
td {
    min-width: 0;
    padding: var(--space-8px);
    border: none;
}

/*Aleatórios*/
#selecionar-todos {
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

#aviso {
    white-space: nowrap;
}


/*Flash Message*/

#popup-error {
    max-width: min(90vw, 420px);
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: var(--space-16px);
    border-radius: var(--space-8px);
    gap: var(--space-12px);
    color: #ffffff;
    background-color: var(--error);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#popup-error ul {
    margin: 0;
    list-style-type: none;
    line-height: 1.5;
}

#popup-error .popup-error-close {
    align-self: flex-end;
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    background-color: var(--white);
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
}

#popup-error.show {
    opacity: 1;
}

#flashMessage {
    position: fixed;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: #0000006a;
}

.warning-text {
    width: 40%;
    padding: 25px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: var(--space-12px);
    background-color: var(--background-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: fadeIn .7s ease;
    z-index: 99999999;
}

.warning-text .btn-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
}

.warning-text .btn-container button {
    width: 45%;
}

.warning-text .btn-container button:hover {
    filter: brightness(140%);
}

.btn-reject {
    background-color: var(--error);
}

.btn-accept {
    background-color: var(--success);
}


/* RESPONSIVIDADE */

@media (max-width: 1024px) {

    .container {
        width: 70%;
    }

    /*FORMULÁRIOS*/

    .container form {
        width: 100%;
    }

    .button-submit-campo {
        flex-wrap: nowrap;
        gap: var(--space-8px);
    }

    .button-submit-campo .no-form button {
        min-width: 36px;
        min-height: 36px;
        padding: 6px;
    }

    td button img,
    .button-submit-campo button img {
        width: 32px;
        height: 32px;
        object-fit: contain;
    }

    table {
        display: block;
        overflow-x: auto;
    }
}


@media (max-width: 768px) {

    .container {
        width: min(90%, 860px);
    }

    /*FORMULÁRIOS*/

    .container form {
        width: 100%;
    }

    label {
        font-size: var(--fs-p);
    }

    .toggle-btn {
        width: auto;
        min-width: 56px;
    }

    .button-submit-campo {
        flex-wrap: nowrap;
        gap: var(--space-8px);
        justify-content: center;
    }

    .button-submit-campo .no-form button {
        min-width: 40px;
        min-height: 40px;
        padding: 6px;
    }

    td button img,
    .button-submit-campo button img {
        width: 36px;
        height: 36px;
    }

    /*TABELA*/

    #aviso {
        display: none;
        white-space: wrap;
    }

    .warning-text {
        width: min(95%, 420px);
        z-index: 9999999;
    }

    .warning-text .btn-container {
        gap: var(--space-12px);
    }

    .warning-text .btn-container button {
        width: 100%;
        max-width: 220px;
    }

}


@media (max-width: 450px) {

    .container{
        width: min(90%, 860px);
    }

    header nav {
        width: 100%;
    }

    /*FORMULÁRIOS*/

    .container form {
        width: 100%;
    }

    .input-group,
    .input-group-number,
    .input-group-date {
        flex-direction: column;
    }

    .input-campo {
        flex-direction: column;
        gap: var(--space-8px);
    }

    /*TABLE*/
    table {
        overflow-x: auto;
    }

    .button-submit-campo {
        flex-wrap: nowrap;
        gap: var(--space-6px);
    }

    .button-submit-campo .no-form button {
        min-width: 44px;
        min-height: 44px;
        padding: 6px;
    }

    td img,
    td button img,
    .button-submit-campo button img {
        width: 40px;
        height: 40px;
    }

    .tr {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .opcao-retorno {
        h3 {
            font-size: .8em;
        }
    }
}


@media (max-width: 320px) {

    body {
        font-size: var(--fs-pp);
    }

    .container {
        width: 90%;
        height: auto;
    }

    /*FORMULÁRIOS*/

    .container form {
        width: 100%;
    }

    .input-group,
    .input-group-number,
    .input-group-date {
        display: flex;
        flex-direction: column;
    }

    .input-campo {
        flex-direction: column;
        gap: var(--space-8px);
    }

    /*TABELA*/

    #aviso {
        display: none;
        white-space: wrap;
    }

    td img {
        width: var(--space-16px);
        height: var(--space-16px);
    }
}